package com.vcens.dingnotice.message.dingtalk;

import com.vcens.dingnotice.message.dingtalk.producer.*;

/**
 * @Author VeChar
 * @Desc
 * @CreateTime 2018/9/29 15:34 PM
 **/
public class MessageProducer implements MessageFactory {
    @Override
    public DingMessageFactory getMessageType(Integer msgTypeId) {
        //临时硬编码
        if (msgTypeId == 1) {
            return new ActionCardMessageProducer();
        } else if (msgTypeId == 2) {
            return new FeedCardMessageProducer();
        } else if (msgTypeId == 3) {
            return new LinkMessageProducer();
        } else if (msgTypeId == 4) {
            return new MarkdownMessageProducer();
        } else if (msgTypeId == 5) {
            return new SingleTargetActionCardMessageProducer();
        } else if (msgTypeId == 6) {
            return new TextMessageProducer();
        } else {
            return null;
        }
    }
}
